Get access token
POST /api/auth
This POST method is used to receive an access token to be used in other endpoints.
Request details
Body Parameters
Parameter | Type | Possible Values / Format | Description |
---|---|---|---|
client_id | string(UUID v4) | Unique identifier of the client in Keepz system. | |
client_secret | string | Secret key issued to the client during onboarding. Used together with client_id to authenticate the client. Must be kept secure. | |
grant_type | string | client_credentials | The OAuth 2.0 grant type being requested. Defines the flow for obtaining an access token. For server-to-server integrations, this should be client_credentials . |
Headers
Header | Type | Required | Description |
---|---|---|---|
Content-Type | string | Yes | Must be application/json |
Response details
✅ Success Response
If the request is valid, the API returns next payload:
{
"value": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"token_type": "Bearer"
}
}
Inside value object, the following parameters are available:
Parameter | Type | Description |
---|---|---|
access_token | string | The OAuth 2.0 access token issued by the server. Used in the Authorization: Bearer token header for all subsequent API requests. |
expires_in | number | Lifetime of the access token in seconds. After expiry, a new token must be requested. |
token_type | string | The type of token issued. Always Bearer for this API. |
❌ Error Response
If an error occurs, the API returns next payload:
{
"message": "Incorrect credentials",
"statusCode": 5021
}
Parameter | Type | Description |
---|---|---|
message | string | Error message. Details are provided in the dedicated section below. |
statusCode | number | Error status code. Details are provided in the dedicated section below. |
⚠️ Important: Keep your client_secret secure and never expose it in client-side code. The access token expires after 3600 seconds (1 hour) and must be refreshed before expiry.
For more information, see the Status codes section.